<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户中心欢迎页  - ${web.name}${web.additionalTitle!}</title>
<link href="${root}/u/css/main.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/memeber.css" type="text/css" rel="stylesheet" />
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<style>
#recentlyViewed .p-wrap {
    width:170px;
    margin:10px auto 15px auto;
}

#recentlyViewed .p-img {
	margin:auto;width:170px;
}
#recentlyViewed .p-img img {
    width:170px;margin:auto;
}
#recentlyViewed .p-img img:hover {
    opacity: 0.5;
}
#recentlyViewed .p-info {
	line-height:18px;
	margin-top:5px;
}
#recentlyViewed .p-name {
	height:36px;
	overflow:hidden;
}
#recentlyViewed .p-name a {
    color: #666;
    line-height: 18px;
    text-decoration: none;
}
#recentlyViewed .p-name a:hover {
    color: red;
    text-decoration: underline;
}
#recentlyViewed .p-price {
    color:#ff0000;
    font-family:Arial;
    height:30px;
	text-align:center;
    line-height:30px;
}
#recentlyViewed .p-price s {
    text-decoration: none;
}
</style>
<script type="text/javascript">
function chg(n){
	if(n==1){
		location.href="${base}/order/myorder.jspx?cl=tbg_11&paymentStatus=1&memberId=${member.id!}&ass=1";	
	}else if(n==2){
		location.href="${base}/order/myorder.jspx?cl=tbg_11&shippingStatus=2&status=2&memberId=${member.id!}&ass=1";
	}else if(n==3){
		location.href="${base}/order/myorder.jspx?cl=tbg_11&memberId=${member.id!}&shippingStatus=2&paymentStatus=2&discuss=1&ass=1";
	}else if(n==4){
		location.href="${base}/myCoupon.jspx?cl=tbg_16";
	}else if(n==5){
		location.href="${base}/shopScore/myscore.jspx?cl=tbg_17";
	}else{
		location.href="${base}/shopMoney/mymoney.jspx?cl=tbg_18";
	}
}
</script>
</head>
<body>
[#include "../include/会员中心页头顶栏.html"/]
<div class="w1168">
	[#include "会员中心_导航.html"/]
	<div class="user_right">
		<div class="w759">
            <div class="user_ddxx">
                <div class="user_dd">
                    <div class="user_name">
                        <div class="fl">欢迎您，${member.username!}&nbsp;&nbsp;&nbsp;<span>${member.group.name}</span>&nbsp;&nbsp;<span>[<a href="${base}/shopMember/portrait.jspx"> 修改头像 </a>]&nbsp;&nbsp;[<a href="${base}/shopMember/profile.jspx"> 编辑个人资料 </a>]</span></div>
                        <div class="menu_collection"><a href="http://dzd.jeecms.com/collect/mycollect.jspx">我的收藏</a></div>
                        <div class="menu_receivingAddress"><a href="http://dzd.jeecms.com/shopMemberAddress/address_list.jspx">我的收货地址</a></div>
                    </div>
                	<div class="user_type">[#if member.avatar??]<img src="${root}/${member.avatar!}" width="70" height="60"/>[#else]<img src="${root}/img/photo.jpg" width="70" height="60" />[/#if]
                	
                	</div>
                    <div class="user_xxdd">
                        <ul>
                           <li><span>订单提醒：</span>&nbsp;&nbsp;<span onclick="chg(1)">待付款</span>[@order_page paymentStatus='1' memberId=member.id  count='100']( ${tag_pagination.totalCount} )[/@order_page]
                            </li>                     
                            <li onclick="chg(2)">待收货&nbsp;[@order_page shippingStatus='2' memberId=member.id  count='100']( ${tag_pagination.totalCount} )[/@order_page]</li>
                            <li onclick="chg(3)">待评价&nbsp;[@order_page shippingStatus='2' status='4' paymentStatus='2' discuss='1' memberId=member.id  count='100']( ${tag_pagination.totalCount} )[/@order_page]</li>
                            <div class="clear"></div>
                            <li><span>帐户信息：</span>&nbsp;&nbsp;<span onclick="chg(4)">我的优惠券</span>&nbsp;[${couList?size}]</li>
                            <li onclick="chg(5)">我的积分：[ ${member.score!0}]</li>
                            <li onclick="chg(6)">帐户余额&nbsp;[ ${member.money!0} ]</li>
                        </ul>
                    </div>
                </div>
            </div>
        	<div class="clear"></div>
			<div class="tjsp_box" style="overflow:hidden;">
                <div id="recentlyViewed">
                	<h2 class="tjsp_box_tit">最近浏览的商品</h2>
                <div id="liulan"></div>
                </div>
            </div>
        </div>
        
        <div class="w209">
        	<div class="user_gwc">
            	<div class="user_gwc_Bg">已消费金额</div>
                <p>今年已消费<span>￥${money!0.00}</span></p>
            </div>
            <div class="user_cjwt">
			[@shop_Channel count='21']
          	     [#list tag_list as c]
					 [#if c_index==20]
						<div class="user_cjwt_Bg">${c.name!}</div>
					 [/#if]
				[/#list]
          	[/@shop_Channel]    
                <div class="clear"></div>
                <ul>
				[@shop_Channel count='21']
          	     [#list tag_list as c]
					 [#if c_index==20]
						 [@shop_ArticleList channelId=c.id count='5']
							[#list tag_list as a]
							<li><a href="${a.url!}" target="_blank">${a.title!}</a></li>
							[/#list]
						 [/@shop_ArticleList]
					[/#if]
				[/#list]
          	[/@shop_Channel] 
                </ul>
            </div>
        </div>
     </div>
     <div class="clear10"></div><div class="clear10"></div>
</div>
[#include "../include/页脚信息栏.html"/]
<script type="text/javascript">
		
		var id = "product";
		var price = "price";
		var title = "title";
		var pic = "pic";
		var url = "url";

		
		//*取出cookie并显示
		for(i = 0 ;i<4;i++){
			title = title+i;
			price = price+i;
			pic = pic+i;
			url = url+i;
			var arr0 = document.cookie.match(new RegExp("(^| )"+title+"=([^;]*)(;|$)"));
			var arr1 = document.cookie.match(new RegExp("(^| )"+price+"=([^;]*)(;|$)"));
			var arr2 = document.cookie.match(new RegExp("(^| )"+pic+"=([^;]*)(;|$)"));
			var arr3 = document.cookie.match(new RegExp("(^| )"+url+"=([^;]*)(;|$)"));
			if(arr0 != null ){
				var str = "<ul><li>"+
					"<div class='p-wrap'>"+
				"<div class='p-img'>"+
				"<a target='_blank' href="+unescape(arr3[2])+">"+
				"<img src='"+unescape(arr2[2])+"'>"+
				"</a>"+
				"</div>"+
				"<div class='p-info'>"+
				"<div class='p-name'>"+
				"<a target='_blank' title='"+unescape(arr0[2])+"' href='"+unescape(arr3[2])+"'>"+unescape(arr0[2])+"</a>"+
				"</div>"+
				"<div class='p-price'>"+
				"<s>￥</s>"+unescape(arr1[2])+
				"</div>"+
				"</div>"+
				"</div>"+
				"</li></ul>";
				$("#liulan").append(str);
			}
			price = "price";
			title = "title";
			pic = "pic";
			url = "url";
		}
		
		var number = 4;
		SetCookie();
		function SetCookie()//两个参数，一个是cookie的名子，一个是值
		{
			var Days = 30; //此 cookie 将被保存 30 天
		    var exp  = new Date();    //new Date("December 31, 9998");
		    exp.setTime(exp.getTime() + Days*24*60*60*1000);
			for(i = 0 ;i<4;i++){
				id = id+i;
				var arr = document.cookie.match(new RegExp("(^| )"+id+"=([^;]*)(;|$)"));
				if(arr != null && getCookie(id) == p_id){
					title = title+i;
					price = price+i;
					pic = pic+i;
					url = url+i;
					delCookie(id);
					delCookie(title);
					delCookie(price);
					delCookie(pic);
					delCookie(url);
					number = i;
				}
				id = "product";
				price = "price";
				title = "title";
				pic = "pic";
				url = "url";
			}
			for(var i = number ;i>0;i--){
				id0 = id+(i-1);
			    price0 = price+(i-1);
			    title0 = title+(i-1);
			    pic0 = pic+(i-1);
			    url0 = url+(i-1);
			    id = id +i;
			    price = price+i;
			    title = title+i;
			    pic = pic+i;
			    url = url + i;
			    if(getCookie(id0) != null){
			    	document.cookie = id + "="+ escape (getCookie(id0)) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
				    document.cookie = price + "="+ escape (getCookie(price0)) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
				    document.cookie = title + "="+ escape (getCookie(title0)) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
				    document.cookie = pic + "="+ escape (getCookie(pic0)) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
				    document.cookie = url + "="+ escape (getCookie(url0)) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
			    }
			    
			    id = "product";
			    price = "price";
				title = "title";
				pic = "pic";
				url = "url";
			}
			
		    
			//* 让当前商品相关cookie保存为第0个
		    id = id+"0";
		    price = price+"0";
		    title = title+"0";
		    pic = pic+"0";
		    url = url +"0";
		    document.cookie = id + "="+ escape (p_id) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
		    document.cookie = price + "="+ escape (p_price) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
		    document.cookie = title + "="+ escape (p_title) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
		    document.cookie = pic + "="+ escape (p_pic) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
		    document.cookie = url + "="+ escape (p_url) + ";expires=" + exp.toGMTString()+";path=/;domain=.jeecms.com";
		    id = "product";
		    price = "price";
			title = "title";
			pic = "pic";
			url = "url";
		}
		
		
		
		function getCookie(name){//取cookies函数 
				var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
				if(arr != null ){
					return unescape(arr[2]);
				}else if(i == 4){
					return null;
				}
		}
		function delCookie(name)//删除cookie
		{
		    var exp = new Date();
		    exp.setTime(exp.getTime() - 1);
		    var cval=getCookie(name);
		    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();
		}
		</script>
</body>
</html>